package com.zhledu.mapreduce.collegename;

import org.apache.hadoop.io.Text;
import org.apache.hadoop.mapreduce.Reducer;

import java.io.IOException;


public class CollegeNameReduce extends Reducer<Text, Text, Text, Text> {
    @Override
    protected void reduce(Text key, Iterable<Text> values, Reducer<Text, Text, Text, Text>.Context context) throws IOException, InterruptedException {
        StringBuffer sb = new StringBuffer();
        for (Text name : values) {
            sb.append(name.toString() + ",");
        }
        context.write(key, new Text(sb.toString()));

    }
}
